Skip to content

[codex] Structure missing provider command failures#3384

Merged
juliusmarminge merged 3 commits into
mainfrom
codex/structure-provider-command-errors
Jun 20, 2026
Merged

[codex] Structure missing provider command failures#3384
juliusmarminge merged 3 commits into
mainfrom
codex/structure-provider-command-errors

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • replace the message-only provider command execution error with a schema-backed missing-command error
  • retain binary path, exit code, and stdout/stderr lengths without storing subprocess output
  • keep missing-command classification compatible with ordinary spawn errors

Validation

  • vp test apps/server/src/provider/providerSnapshot.test.ts (2 tests)
  • vp check
  • vp run typecheck

Note

Low Risk
Localized provider probe error typing and classification; behavior for callers using isCommandMissingCause is tightened but still covers platform NotFound and the new tagged error.

Overview
Replaces the message-only ProviderCommandExecutionError with a schema-backed ProviderCommandNotFoundError when a provider CLI is missing (e.g. Windows exit 9009). The error carries binaryPath, exitCode, and stdout/stderr lengths only—no subprocess text on the failure object, so diagnostics stay safe for logs/UI.

spawnAndCollect now fails with this type instead of a generic spawn … ENOENT string. isCommandMissingCause recognizes the tagged error and PlatformError NotFound spawn failures, and no longer treats arbitrary message substrings (e.g. legacy ENOENT strings) as missing-command signals.

New tests cover classification and that sensitive stderr is not exposed on the error or its message.

Reviewed by Cursor Bugbot for commit 507eee5. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Structure provider command-not-found failures into a typed ProviderCommandNotFoundError

  • Introduces ProviderCommandNotFoundError in providerSnapshot.ts, a schema-tagged error with binaryPath, exitCode, stdoutLength, and stderrLength fields and a stable message getter.
  • Updates isCommandMissingCause to classify errors by normalized platform error type (PlatformError with reason NotFound) instead of parsing message strings; generic Error instances containing ENOENT no longer match.
  • Updates spawnAndCollect to emit ProviderCommandNotFoundError (with structured diagnostics) instead of a message-only ProviderCommandExecutionError on Windows command-not-found exits.
  • Adds tests in providerSnapshot.test.ts verifying classification behavior and that sensitive output (e.g. tokens in stderr) is not leaked in the error message.

Macroscope summarized 507eee5.

Co-authored-by: codex <codex@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 304cb901-aef3-47f9-8168-bada799f145f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/structure-provider-command-errors

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jun 20, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Refactors provider command error handling from string-parsing to structured, type-safe error classes. The change improves error diagnostics without altering when errors are thrown, and includes comprehensive test coverage.

You can customize Macroscope's approvability policy. Learn more.

Co-authored-by: codex <codex@users.noreply.github.com>
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 16:24

Dismissing prior approval to re-evaluate 74c760b

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 17:36

Dismissing prior approval to re-evaluate 507eee5

@juliusmarminge juliusmarminge merged commit 300d4d5 into main Jun 20, 2026
16 checks passed
@juliusmarminge juliusmarminge deleted the codex/structure-provider-command-errors branch June 20, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant